package com.hw.one.collect.ocec.util;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by guo on 2018/3/20.
 */
public class CsvUtil {
	public static final List<String> parse(String defineFilePath) {
		List<String> list = new ArrayList<>();
		BufferedReader br = null;
		String temp = null;
		String path = null;
		if (null != defineFilePath && defineFilePath.trim().length() > 0) {
			path = defineFilePath;
		} else {
			return null;
		}
		try {
			br = new BufferedReader(new FileReader(path));
			while ((temp = br.readLine()) != null) {
				list.add(temp);
			}
			return list;
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (null != br) {
					br.close();
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return null;
	}

}
